package org.microsites.remote.dwr;

import java.util.List;

import org.microsites.domain.model.Entity;
import org.microsites.remote.GenericRemote;
import org.microsites.service.GenericService;

public abstract class GenericRemoteImpl<T extends Entity> implements GenericRemote<T> {

	public abstract GenericService<T> getService();

	@Override
	public List<String> autocomplete(String column, String pattern) {
		return getService().autocomplete(column, pattern);
	}

	@Override
	public T create(T entity) {
		getService().create(entity);
		return entity;
	}

	@Override
	public T edit(Long id) {
		return getService().edit(id);
	}

	@Override
	public void keep(Long id) {
		getService().keep(id);
	}

	@Override
	public List<T> list() {
		return getService().list();
	}

    @Override
    public T load(Long id) {
        return getService().load(id);
    }

    @Override
    public List<Entity> loadPath(Long id) {
        return getService().loadPath(id);
    }

	@Override
	public void release(Long id) {
		getService().release(id);
	}

	@Override
	public void remove(Long id) {
		getService().release(id);
	}

	@Override
	public List<T> sublist(Long id) {
		return getService().sublist(id);
	}

	@Override
	public void update(T entity) {
		getService().update(entity);
	}

}
